import React from 'react';
import { Config } from '../types';
import BaseMenu from '@/layout/Menu';
import { Root, Lazy } from '@/components'
import {
  AppstoreOutlined,
  FileImageOutlined
} from '@ant-design/icons';
import appRoutes from './app';
import imageRoutes from './image';

export default [
  {
    path: '/',
    component: Root,
    routes: [
      {
        path: '/',
        exact: true,
        redirect: '/user/login'
      },
      {
        exact: true,
        path: '/user/login',
        desc: '登录页面',
        component: Lazy(() => import('../../pages/login'))
      },
      {
        path: '/home',
        desc: '菜单路由',
        component: BaseMenu,
        routes: [
          {
            title: '应用管理',
            path: '/home/app',
            component: Root,
            routes: appRoutes,
            icon: <AppstoreOutlined />
          },
          {
            title: '图片管理',
            path: '/home/image',
            component: Root,
            routes: imageRoutes,
            icon: <FileImageOutlined />
          }
        ]
      }
    ]
  }
] as Config[];
